<!--
 * @Author: HeAo
 * @Date: 2022-08-25 14:25:15
 * @LastEditTime: 2022-08-25 19:42:10
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \JavaScripe\day-14BOM\01-window对象.html
 * 别乱动！
-->
<!-- 在html中 var声明的会变为全局变量  创建的东西都会存在于window里成为它的属性，所以我们可以通过window.name -->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 1、window作为浏览器的实例对象 name等价于window中的属性
    var name = 'zhangsan'
    var sayName = function () {
      console.log(this.name);
    }
    sayName()
    console.log(this);

    // // 窗口位置screenLeft、screenTop
    // console.log(window.screenLeft, window.screenTop);
    // // 窗口大小 innerHeight innerWidth
    // console.log(window.innerHeight, window.innerWidth);
  </script>

</body>

</html>